import tkinter as tk

def change_color():
    button.config(bg="red")

# 创建主窗口
root = tk.Tk()

# 创建按钮，并设置背景颜色为蓝色
button = tk.Button(root, text="Click me!", bg="blue")
button.pack()

# 创建按钮，点击后改变按钮背景颜色为红色
change_color_button = tk.Button(root, text="Change color", command=change_color)
change_color_button.pack()

# 运行主循环
root.mainloop()

